package com.google.android.gms.internal;

import android.annotation.TargetApi;
import android.graphics.Point;
import android.support.annotation.Nullable;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import com.google.android.gms.ads.formats.NativeAppInstallAd;
import com.google.android.gms.ads.formats.NativeContentAd;
import com.google.android.gms.ads.internal.zzbt;
import com.google.android.gms.common.internal.Hide;
import com.google.android.gms.common.util.zzs;
import com.google.android.gms.dynamic.IObjectWrapper;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

@Hide
@zzabh
public final class zzqj extends zzqx implements View.OnClickListener, View.OnTouchListener, ViewTreeObserver.OnGlobalLayoutListener, ViewTreeObserver.OnScrollChangedListener {
    private static String[] zzbzo = {NativeAppInstallAd.ASSET_MEDIA_VIDEO, NativeContentAd.ASSET_MEDIA_VIDEO, "3010"};
    private final Object mLock = new Object();
    @Nullable
    private FrameLayout zzamk;
    @Nullable
    private zzpv zzbyi;
    private final FrameLayout zzbzp;
    private View zzbzq;
    private final boolean zzbzr;
    private Map<String, WeakReference<View>> zzbzs = Collections.synchronizedMap(new HashMap());
    @Nullable
    private View zzbzt;
    private boolean zzbzu = false;
    private Point zzbzv = new Point();
    private Point zzbzw = new Point();
    private WeakReference<zzgr> zzbzx = new WeakReference<>((Object) null);

    @TargetApi(21)
    public zzqj(FrameLayout frameLayout, FrameLayout frameLayout2) {
        this.zzbzp = frameLayout;
        this.zzamk = frameLayout2;
        zzbt.zzfg();
        zzaml.zza((View) this.zzbzp, (ViewTreeObserver.OnGlobalLayoutListener) this);
        zzbt.zzfg();
        zzaml.zza((View) this.zzbzp, (ViewTreeObserver.OnScrollChangedListener) this);
        this.zzbzp.setOnTouchListener(this);
        this.zzbzp.setOnClickListener(this);
        if (frameLayout2 != null && zzs.zzanx()) {
            frameLayout2.setElevation(Float.MAX_VALUE);
        }
        zzoi.initialize(this.zzbzp.getContext());
        this.zzbzr = ((Boolean) zzlc.zzio().zzd(zzoi.zzbsv)).booleanValue();
    }

    private final void zzk(@Nullable View view) {
        if (this.zzbyi != null) {
            zzpv zzkp = this.zzbyi instanceof zzpu ? ((zzpu) this.zzbyi).zzkp() : this.zzbyi;
            if (zzkp != null) {
                zzkp.zzk(view);
            }
        }
    }

    private final View zzkv() {
        if (this.zzbzs == null) {
            return null;
        }
        for (String str : zzbzo) {
            WeakReference weakReference = this.zzbzs.get(str);
            if (weakReference != null) {
                return (View) weakReference.get();
            }
        }
        return null;
    }

    private final void zzkw() {
        synchronized (this.mLock) {
            if (!this.zzbzr && this.zzbzu) {
                int measuredWidth = this.zzbzp.getMeasuredWidth();
                int measuredHeight = this.zzbzp.getMeasuredHeight();
                if (!(measuredWidth == 0 || measuredHeight == 0 || this.zzamk == null)) {
                    this.zzamk.setLayoutParams(new FrameLayout.LayoutParams(measuredWidth, measuredHeight));
                    this.zzbzu = false;
                }
            }
        }
    }

    private final int zzt(int i) {
        zzlc.zzij();
        return zzako.zzb(this.zzbyi.getContext(), i);
    }

    public final void destroy() {
        synchronized (this.mLock) {
            if (this.zzamk != null) {
                this.zzamk.removeAllViews();
            }
            this.zzamk = null;
            this.zzbzs = null;
            this.zzbzt = null;
            this.zzbyi = null;
            this.zzbzv = null;
            this.zzbzw = null;
            this.zzbzx = null;
            this.zzbzq = null;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0088, code lost:
        return;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onClick(android.view.View r8) {
        /*
            r7 = this;
            java.lang.Object r0 = r7.mLock
            monitor-enter(r0)
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            if (r1 != 0) goto L_0x0009
            monitor-exit(r0)     // Catch:{ all -> 0x0089 }
            return
        L_0x0009:
            android.os.Bundle r4 = new android.os.Bundle     // Catch:{ all -> 0x0089 }
            r4.<init>()     // Catch:{ all -> 0x0089 }
            java.lang.String r1 = "x"
            android.graphics.Point r2 = r7.zzbzv     // Catch:{ all -> 0x0089 }
            int r2 = r2.x     // Catch:{ all -> 0x0089 }
            int r2 = r7.zzt(r2)     // Catch:{ all -> 0x0089 }
            float r2 = (float) r2     // Catch:{ all -> 0x0089 }
            r4.putFloat(r1, r2)     // Catch:{ all -> 0x0089 }
            java.lang.String r1 = "y"
            android.graphics.Point r2 = r7.zzbzv     // Catch:{ all -> 0x0089 }
            int r2 = r2.y     // Catch:{ all -> 0x0089 }
            int r2 = r7.zzt(r2)     // Catch:{ all -> 0x0089 }
            float r2 = (float) r2     // Catch:{ all -> 0x0089 }
            r4.putFloat(r1, r2)     // Catch:{ all -> 0x0089 }
            java.lang.String r1 = "start_x"
            android.graphics.Point r2 = r7.zzbzw     // Catch:{ all -> 0x0089 }
            int r2 = r2.x     // Catch:{ all -> 0x0089 }
            int r2 = r7.zzt(r2)     // Catch:{ all -> 0x0089 }
            float r2 = (float) r2     // Catch:{ all -> 0x0089 }
            r4.putFloat(r1, r2)     // Catch:{ all -> 0x0089 }
            java.lang.String r1 = "start_y"
            android.graphics.Point r2 = r7.zzbzw     // Catch:{ all -> 0x0089 }
            int r2 = r2.y     // Catch:{ all -> 0x0089 }
            int r2 = r7.zzt(r2)     // Catch:{ all -> 0x0089 }
            float r2 = (float) r2     // Catch:{ all -> 0x0089 }
            r4.putFloat(r1, r2)     // Catch:{ all -> 0x0089 }
            android.view.View r1 = r7.zzbzt     // Catch:{ all -> 0x0089 }
            if (r1 == 0) goto L_0x007e
            android.view.View r1 = r7.zzbzt     // Catch:{ all -> 0x0089 }
            boolean r1 = r1.equals(r8)     // Catch:{ all -> 0x0089 }
            if (r1 == 0) goto L_0x007e
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            boolean r1 = r1 instanceof com.google.android.gms.internal.zzpu     // Catch:{ all -> 0x0089 }
            if (r1 == 0) goto L_0x0075
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            com.google.android.gms.internal.zzpu r1 = (com.google.android.gms.internal.zzpu) r1     // Catch:{ all -> 0x0089 }
            com.google.android.gms.internal.zzpv r1 = r1.zzkp()     // Catch:{ all -> 0x0089 }
            if (r1 == 0) goto L_0x0087
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            com.google.android.gms.internal.zzpu r1 = (com.google.android.gms.internal.zzpu) r1     // Catch:{ all -> 0x0089 }
            com.google.android.gms.internal.zzpv r1 = r1.zzkp()     // Catch:{ all -> 0x0089 }
            java.lang.String r3 = "1007"
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r5 = r7.zzbzs     // Catch:{ all -> 0x0089 }
            android.widget.FrameLayout r6 = r7.zzbzp     // Catch:{ all -> 0x0089 }
        L_0x0070:
            r2 = r8
            r1.zza(r2, r3, r4, r5, r6)     // Catch:{ all -> 0x0089 }
            goto L_0x0087
        L_0x0075:
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            java.lang.String r3 = "1007"
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r5 = r7.zzbzs     // Catch:{ all -> 0x0089 }
            android.widget.FrameLayout r6 = r7.zzbzp     // Catch:{ all -> 0x0089 }
            goto L_0x0070
        L_0x007e:
            com.google.android.gms.internal.zzpv r1 = r7.zzbyi     // Catch:{ all -> 0x0089 }
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r2 = r7.zzbzs     // Catch:{ all -> 0x0089 }
            android.widget.FrameLayout r3 = r7.zzbzp     // Catch:{ all -> 0x0089 }
            r1.zza(r8, r2, r4, r3)     // Catch:{ all -> 0x0089 }
        L_0x0087:
            monitor-exit(r0)     // Catch:{ all -> 0x0089 }
            return
        L_0x0089:
            r8 = move-exception
            monitor-exit(r0)     // Catch:{ all -> 0x0089 }
            throw r8
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.zzqj.onClick(android.view.View):void");
    }

    public final void onGlobalLayout() {
        synchronized (this.mLock) {
            zzkw();
            if (this.zzbyi != null) {
                this.zzbyi.zzc(this.zzbzp, this.zzbzs);
            }
        }
    }

    public final void onScrollChanged() {
        synchronized (this.mLock) {
            if (this.zzbyi != null) {
                this.zzbyi.zzc(this.zzbzp, this.zzbzs);
            }
            zzkw();
        }
    }

    public final boolean onTouch(View view, MotionEvent motionEvent) {
        synchronized (this.mLock) {
            if (this.zzbyi == null) {
                return false;
            }
            int[] iArr = new int[2];
            this.zzbzp.getLocationOnScreen(iArr);
            Point point = new Point((int) (motionEvent.getRawX() - ((float) iArr[0])), (int) (motionEvent.getRawY() - ((float) iArr[1])));
            this.zzbzv = point;
            if (motionEvent.getAction() == 0) {
                this.zzbzw = point;
            }
            MotionEvent obtain = MotionEvent.obtain(motionEvent);
            obtain.setLocation((float) point.x, (float) point.y);
            this.zzbyi.zzd(obtain);
            obtain.recycle();
            return false;
        }
    }

    /*  JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor
        java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
        	at java.util.ArrayList.get(ArrayList.java:433)
        	at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
        	at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
        	at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
        	at jadx.core.dex.visitors.regions.RegionMaker.processIf(RegionMaker.java:698)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:123)
        	at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
        	at jadx.core.dex.visitors.regions.RegionMaker.processIf(RegionMaker.java:698)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:123)
        	at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
        	at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:598)
        	at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
        	at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
        	at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:49)
        */
    /* JADX WARNING: Removed duplicated region for block: B:67:0x0109 A[Catch:{ Exception -> 0x0186 }] */
    /* JADX WARNING: Removed duplicated region for block: B:77:0x0154 A[Catch:{ Exception -> 0x0186 }] */
    public final void zza(com.google.android.gms.dynamic.IObjectWrapper r12) {
        /*
            r11 = this;
            java.lang.Object r0 = r11.mLock
            monitor-enter(r0)
            r1 = 0
            r11.zzk(r1)     // Catch:{ all -> 0x0228 }
            java.lang.Object r12 = com.google.android.gms.dynamic.zzn.zzy(r12)     // Catch:{ all -> 0x0228 }
            boolean r2 = r12 instanceof com.google.android.gms.internal.zzpz     // Catch:{ all -> 0x0228 }
            if (r2 != 0) goto L_0x0016
            java.lang.String r12 = "Not an instance of native engine. This is most likely a transient error"
            com.google.android.gms.internal.zzahw.zzcz(r12)     // Catch:{ all -> 0x0228 }
            monitor-exit(r0)     // Catch:{ all -> 0x0228 }
            return
        L_0x0016:
            boolean r2 = r11.zzbzr     // Catch:{ all -> 0x0228 }
            r3 = 0
            if (r2 != 0) goto L_0x002e
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            if (r2 == 0) goto L_0x002e
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout$LayoutParams r4 = new android.widget.FrameLayout$LayoutParams     // Catch:{ all -> 0x0228 }
            r4.<init>(r3, r3)     // Catch:{ all -> 0x0228 }
            r2.setLayoutParams(r4)     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r2 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            r2.requestLayout()     // Catch:{ all -> 0x0228 }
        L_0x002e:
            r2 = 1
            r11.zzbzu = r2     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpz r12 = (com.google.android.gms.internal.zzpz) r12     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x0052
            com.google.android.gms.internal.zzny<java.lang.Boolean> r4 = com.google.android.gms.internal.zzoi.zzbsn     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzog r5 = com.google.android.gms.internal.zzlc.zzio()     // Catch:{ all -> 0x0228 }
            java.lang.Object r4 = r5.zzd(r4)     // Catch:{ all -> 0x0228 }
            java.lang.Boolean r4 = (java.lang.Boolean) r4     // Catch:{ all -> 0x0228 }
            boolean r4 = r4.booleanValue()     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x0052
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r5 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r6 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            r4.zzb(r5, r6)     // Catch:{ all -> 0x0228 }
        L_0x0052:
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            boolean r4 = r4 instanceof com.google.android.gms.internal.zzpz     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x008c
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpz r4 = (com.google.android.gms.internal.zzpz) r4     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x008c
            android.content.Context r5 = r4.getContext()     // Catch:{ all -> 0x0228 }
            if (r5 == 0) goto L_0x008c
            com.google.android.gms.internal.zzagu r5 = com.google.android.gms.ads.internal.zzbt.zzfh()     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r6 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.content.Context r6 = r6.getContext()     // Catch:{ all -> 0x0228 }
            boolean r5 = r5.zzs(r6)     // Catch:{ all -> 0x0228 }
            if (r5 == 0) goto L_0x008c
            com.google.android.gms.internal.zzagt r4 = r4.zzku()     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x007d
            r4.zzw(r3)     // Catch:{ all -> 0x0228 }
        L_0x007d:
            java.lang.ref.WeakReference<com.google.android.gms.internal.zzgr> r5 = r11.zzbzx     // Catch:{ all -> 0x0228 }
            java.lang.Object r5 = r5.get()     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzgr r5 = (com.google.android.gms.internal.zzgr) r5     // Catch:{ all -> 0x0228 }
            if (r5 == 0) goto L_0x008c
            if (r4 == 0) goto L_0x008c
            r5.zzb(r4)     // Catch:{ all -> 0x0228 }
        L_0x008c:
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            boolean r4 = r4 instanceof com.google.android.gms.internal.zzpu     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x00a4
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpu r4 = (com.google.android.gms.internal.zzpu) r4     // Catch:{ all -> 0x0228 }
            boolean r4 = r4.zzko()     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x00a4
            com.google.android.gms.internal.zzpv r4 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpu r4 = (com.google.android.gms.internal.zzpu) r4     // Catch:{ all -> 0x0228 }
            r4.zzc(r12)     // Catch:{ all -> 0x0228 }
            goto L_0x00b0
        L_0x00a4:
            r11.zzbyi = r12     // Catch:{ all -> 0x0228 }
            boolean r4 = r12 instanceof com.google.android.gms.internal.zzpu     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x00b0
            r4 = r12
            com.google.android.gms.internal.zzpu r4 = (com.google.android.gms.internal.zzpu) r4     // Catch:{ all -> 0x0228 }
            r4.zzc(r1)     // Catch:{ all -> 0x0228 }
        L_0x00b0:
            android.widget.FrameLayout r4 = r11.zzamk     // Catch:{ all -> 0x0228 }
            if (r4 != 0) goto L_0x00b6
            monitor-exit(r0)     // Catch:{ all -> 0x0228 }
            return
        L_0x00b6:
            com.google.android.gms.internal.zzny<java.lang.Boolean> r4 = com.google.android.gms.internal.zzoi.zzbsn     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzog r5 = com.google.android.gms.internal.zzlc.zzio()     // Catch:{ all -> 0x0228 }
            java.lang.Object r4 = r5.zzd(r4)     // Catch:{ all -> 0x0228 }
            java.lang.Boolean r4 = (java.lang.Boolean) r4     // Catch:{ all -> 0x0228 }
            boolean r4 = r4.booleanValue()     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x00cd
            android.widget.FrameLayout r4 = r11.zzamk     // Catch:{ all -> 0x0228 }
            r4.setClickable(r3)     // Catch:{ all -> 0x0228 }
        L_0x00cd:
            android.widget.FrameLayout r4 = r11.zzamk     // Catch:{ all -> 0x0228 }
            r4.removeAllViews()     // Catch:{ all -> 0x0228 }
            boolean r4 = r12.zzkm()     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x00f7
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r5 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            if (r5 == 0) goto L_0x00f7
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r5 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            java.lang.String r6 = "1098"
            java.lang.Object r5 = r5.get(r6)     // Catch:{ all -> 0x0228 }
            java.lang.ref.WeakReference r5 = (java.lang.ref.WeakReference) r5     // Catch:{ all -> 0x0228 }
            if (r5 == 0) goto L_0x00ef
            java.lang.Object r5 = r5.get()     // Catch:{ all -> 0x0228 }
            android.view.View r5 = (android.view.View) r5     // Catch:{ all -> 0x0228 }
            goto L_0x00f0
        L_0x00ef:
            r5 = r1
        L_0x00f0:
            boolean r6 = r5 instanceof android.view.ViewGroup     // Catch:{ all -> 0x0228 }
            if (r6 == 0) goto L_0x00f7
            android.view.ViewGroup r5 = (android.view.ViewGroup) r5     // Catch:{ all -> 0x0228 }
            goto L_0x00f8
        L_0x00f7:
            r5 = r1
        L_0x00f8:
            if (r4 == 0) goto L_0x00fd
            if (r5 == 0) goto L_0x00fd
            goto L_0x00fe
        L_0x00fd:
            r2 = r3
        L_0x00fe:
            android.view.View r4 = r12.zza((android.view.View.OnClickListener) r11, (boolean) r2)     // Catch:{ all -> 0x0228 }
            r11.zzbzt = r4     // Catch:{ all -> 0x0228 }
            android.view.View r4 = r11.zzbzt     // Catch:{ all -> 0x0228 }
            r10 = -1
            if (r4 == 0) goto L_0x0145
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r4 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            if (r4 == 0) goto L_0x011b
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r4 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            java.lang.String r6 = "1007"
            java.lang.ref.WeakReference r7 = new java.lang.ref.WeakReference     // Catch:{ all -> 0x0228 }
            android.view.View r8 = r11.zzbzt     // Catch:{ all -> 0x0228 }
            r7.<init>(r8)     // Catch:{ all -> 0x0228 }
            r4.put(r6, r7)     // Catch:{ all -> 0x0228 }
        L_0x011b:
            if (r2 == 0) goto L_0x0126
            r5.removeAllViews()     // Catch:{ all -> 0x0228 }
            android.view.View r2 = r11.zzbzt     // Catch:{ all -> 0x0228 }
            r5.addView(r2)     // Catch:{ all -> 0x0228 }
            goto L_0x0145
        L_0x0126:
            android.content.Context r2 = r12.getContext()     // Catch:{ all -> 0x0228 }
            com.google.android.gms.ads.formats.AdChoicesView r4 = new com.google.android.gms.ads.formats.AdChoicesView     // Catch:{ all -> 0x0228 }
            r4.<init>(r2)     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout$LayoutParams r2 = new android.widget.FrameLayout$LayoutParams     // Catch:{ all -> 0x0228 }
            r2.<init>(r10, r10)     // Catch:{ all -> 0x0228 }
            r4.setLayoutParams(r2)     // Catch:{ all -> 0x0228 }
            android.view.View r2 = r11.zzbzt     // Catch:{ all -> 0x0228 }
            r4.addView(r2)     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            if (r2 == 0) goto L_0x0145
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            r2.addView(r4)     // Catch:{ all -> 0x0228 }
        L_0x0145:
            android.widget.FrameLayout r5 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r6 = r11.zzbzs     // Catch:{ all -> 0x0228 }
            r7 = 0
            r4 = r12
            r8 = r11
            r9 = r11
            r4.zza((android.view.View) r5, (java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>>) r6, (java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>>) r7, (android.view.View.OnTouchListener) r8, (android.view.View.OnClickListener) r9)     // Catch:{ all -> 0x0228 }
            boolean r2 = r11.zzbzr     // Catch:{ all -> 0x0228 }
            if (r2 == 0) goto L_0x0180
            android.view.View r2 = r11.zzbzq     // Catch:{ all -> 0x0228 }
            if (r2 != 0) goto L_0x016f
            android.view.View r2 = new android.view.View     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r4 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.content.Context r4 = r4.getContext()     // Catch:{ all -> 0x0228 }
            r2.<init>(r4)     // Catch:{ all -> 0x0228 }
            r11.zzbzq = r2     // Catch:{ all -> 0x0228 }
            android.view.View r2 = r11.zzbzq     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout$LayoutParams r4 = new android.widget.FrameLayout$LayoutParams     // Catch:{ all -> 0x0228 }
            r4.<init>(r10, r3)     // Catch:{ all -> 0x0228 }
            r2.setLayoutParams(r4)     // Catch:{ all -> 0x0228 }
        L_0x016f:
            android.widget.FrameLayout r2 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.view.View r3 = r11.zzbzq     // Catch:{ all -> 0x0228 }
            android.view.ViewParent r3 = r3.getParent()     // Catch:{ all -> 0x0228 }
            if (r2 == r3) goto L_0x0180
            android.widget.FrameLayout r2 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.view.View r3 = r11.zzbzq     // Catch:{ all -> 0x0228 }
            r2.addView(r3)     // Catch:{ all -> 0x0228 }
        L_0x0180:
            com.google.android.gms.internal.zzaof r2 = r12.zzkq()     // Catch:{ Exception -> 0x0186 }
            r1 = r2
            goto L_0x019b
        L_0x0186:
            r2 = move-exception
            com.google.android.gms.ads.internal.zzbt.zzen()     // Catch:{ all -> 0x0228 }
            boolean r3 = com.google.android.gms.internal.zzaip.zzrk()     // Catch:{ all -> 0x0228 }
            if (r3 == 0) goto L_0x0196
            java.lang.String r2 = "Privileged processes cannot create HTML overlays."
            com.google.android.gms.internal.zzahw.zzcz(r2)     // Catch:{ all -> 0x0228 }
            goto L_0x019b
        L_0x0196:
            java.lang.String r3 = "Error obtaining overlay."
            com.google.android.gms.internal.zzahw.zzb(r3, r2)     // Catch:{ all -> 0x0228 }
        L_0x019b:
            if (r1 == 0) goto L_0x01aa
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            if (r2 == 0) goto L_0x01aa
            android.widget.FrameLayout r2 = r11.zzamk     // Catch:{ all -> 0x0228 }
            android.view.View r1 = r1.getView()     // Catch:{ all -> 0x0228 }
            r2.addView(r1)     // Catch:{ all -> 0x0228 }
        L_0x01aa:
            java.lang.Object r1 = r11.mLock     // Catch:{ all -> 0x0228 }
            monitor-enter(r1)     // Catch:{ all -> 0x0228 }
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r2 = r11.zzbzs     // Catch:{ all -> 0x0225 }
            r12.zzh(r2)     // Catch:{ all -> 0x0225 }
            android.view.View r2 = r11.zzkv()     // Catch:{ all -> 0x0225 }
            boolean r3 = r2 instanceof android.widget.FrameLayout     // Catch:{ all -> 0x0225 }
            if (r3 != 0) goto L_0x01bf
            r12.zzks()     // Catch:{ all -> 0x0225 }
        L_0x01bd:
            monitor-exit(r1)     // Catch:{ all -> 0x0225 }
            goto L_0x01d0
        L_0x01bf:
            com.google.android.gms.internal.zzqk r3 = new com.google.android.gms.internal.zzqk     // Catch:{ all -> 0x0225 }
            r3.<init>(r11, r2)     // Catch:{ all -> 0x0225 }
            boolean r4 = r12 instanceof com.google.android.gms.internal.zzpu     // Catch:{ all -> 0x0225 }
            if (r4 == 0) goto L_0x01cc
            r12.zzb((android.view.View) r2, (com.google.android.gms.internal.zzpt) r3)     // Catch:{ all -> 0x0225 }
            goto L_0x01bd
        L_0x01cc:
            r12.zza((android.view.View) r2, (com.google.android.gms.internal.zzpt) r3)     // Catch:{ all -> 0x0225 }
            goto L_0x01bd
        L_0x01d0:
            android.widget.FrameLayout r12 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            r11.zzk(r12)     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpv r12 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r1 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            r12.zzi(r1)     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpv r12 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            boolean r12 = r12 instanceof com.google.android.gms.internal.zzpz     // Catch:{ all -> 0x0228 }
            if (r12 == 0) goto L_0x0223
            com.google.android.gms.internal.zzpv r12 = r11.zzbyi     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzpz r12 = (com.google.android.gms.internal.zzpz) r12     // Catch:{ all -> 0x0228 }
            if (r12 == 0) goto L_0x0223
            android.content.Context r1 = r12.getContext()     // Catch:{ all -> 0x0228 }
            if (r1 == 0) goto L_0x0223
            com.google.android.gms.internal.zzagu r1 = com.google.android.gms.ads.internal.zzbt.zzfh()     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r2 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.content.Context r2 = r2.getContext()     // Catch:{ all -> 0x0228 }
            boolean r1 = r1.zzs(r2)     // Catch:{ all -> 0x0228 }
            if (r1 == 0) goto L_0x0223
            java.lang.ref.WeakReference<com.google.android.gms.internal.zzgr> r1 = r11.zzbzx     // Catch:{ all -> 0x0228 }
            java.lang.Object r1 = r1.get()     // Catch:{ all -> 0x0228 }
            com.google.android.gms.internal.zzgr r1 = (com.google.android.gms.internal.zzgr) r1     // Catch:{ all -> 0x0228 }
            if (r1 != 0) goto L_0x021c
            com.google.android.gms.internal.zzgr r1 = new com.google.android.gms.internal.zzgr     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r2 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            android.content.Context r2 = r2.getContext()     // Catch:{ all -> 0x0228 }
            android.widget.FrameLayout r3 = r11.zzbzp     // Catch:{ all -> 0x0228 }
            r1.<init>(r2, r3)     // Catch:{ all -> 0x0228 }
            java.lang.ref.WeakReference r2 = new java.lang.ref.WeakReference     // Catch:{ all -> 0x0228 }
            r2.<init>(r1)     // Catch:{ all -> 0x0228 }
            r11.zzbzx = r2     // Catch:{ all -> 0x0228 }
        L_0x021c:
            com.google.android.gms.internal.zzagt r12 = r12.zzku()     // Catch:{ all -> 0x0228 }
            r1.zza((com.google.android.gms.internal.zzgv) r12)     // Catch:{ all -> 0x0228 }
        L_0x0223:
            monitor-exit(r0)     // Catch:{ all -> 0x0228 }
            return
        L_0x0225:
            r12 = move-exception
            monitor-exit(r1)     // Catch:{ all -> 0x0225 }
            throw r12     // Catch:{ all -> 0x0228 }
        L_0x0228:
            r12 = move-exception
            monitor-exit(r0)     // Catch:{ all -> 0x0228 }
            throw r12
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.zzqj.zza(com.google.android.gms.dynamic.IObjectWrapper):void");
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r4v5, resolved type: java.lang.Object} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r2v2, resolved type: android.view.View} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final com.google.android.gms.dynamic.IObjectWrapper zzal(java.lang.String r4) {
        /*
            r3 = this;
            java.lang.Object r0 = r3.mLock
            monitor-enter(r0)
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r1 = r3.zzbzs     // Catch:{ all -> 0x0022 }
            r2 = 0
            if (r1 != 0) goto L_0x000a
            monitor-exit(r0)     // Catch:{ all -> 0x0022 }
            return r2
        L_0x000a:
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r1 = r3.zzbzs     // Catch:{ all -> 0x0022 }
            java.lang.Object r4 = r1.get(r4)     // Catch:{ all -> 0x0022 }
            java.lang.ref.WeakReference r4 = (java.lang.ref.WeakReference) r4     // Catch:{ all -> 0x0022 }
            if (r4 != 0) goto L_0x0015
            goto L_0x001c
        L_0x0015:
            java.lang.Object r4 = r4.get()     // Catch:{ all -> 0x0022 }
            r2 = r4
            android.view.View r2 = (android.view.View) r2     // Catch:{ all -> 0x0022 }
        L_0x001c:
            com.google.android.gms.dynamic.IObjectWrapper r4 = com.google.android.gms.dynamic.zzn.zzz(r2)     // Catch:{ all -> 0x0022 }
            monitor-exit(r0)     // Catch:{ all -> 0x0022 }
            return r4
        L_0x0022:
            r4 = move-exception
            monitor-exit(r0)     // Catch:{ all -> 0x0022 }
            throw r4
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.zzqj.zzal(java.lang.String):com.google.android.gms.dynamic.IObjectWrapper");
    }

    public final void zzb(IObjectWrapper iObjectWrapper, int i) {
        zzgr zzgr;
        if (!(!zzbt.zzfh().zzs(this.zzbzp.getContext()) || this.zzbzx == null || (zzgr = (zzgr) this.zzbzx.get()) == null)) {
            zzgr.zzgm();
        }
        zzkw();
    }

    /* JADX WARNING: Code restructure failed: missing block: B:15:0x0036, code lost:
        return;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void zzb(java.lang.String r4, com.google.android.gms.dynamic.IObjectWrapper r5) {
        /*
            r3 = this;
            java.lang.Object r5 = com.google.android.gms.dynamic.zzn.zzy(r5)
            android.view.View r5 = (android.view.View) r5
            java.lang.Object r0 = r3.mLock
            monitor-enter(r0)
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r1 = r3.zzbzs     // Catch:{ all -> 0x0037 }
            if (r1 != 0) goto L_0x000f
            monitor-exit(r0)     // Catch:{ all -> 0x0037 }
            return
        L_0x000f:
            if (r5 != 0) goto L_0x0017
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r5 = r3.zzbzs     // Catch:{ all -> 0x0037 }
            r5.remove(r4)     // Catch:{ all -> 0x0037 }
            goto L_0x0035
        L_0x0017:
            java.util.Map<java.lang.String, java.lang.ref.WeakReference<android.view.View>> r1 = r3.zzbzs     // Catch:{ all -> 0x0037 }
            java.lang.ref.WeakReference r2 = new java.lang.ref.WeakReference     // Catch:{ all -> 0x0037 }
            r2.<init>(r5)     // Catch:{ all -> 0x0037 }
            r1.put(r4, r2)     // Catch:{ all -> 0x0037 }
            java.lang.String r1 = "1098"
            boolean r4 = r1.equals(r4)     // Catch:{ all -> 0x0037 }
            if (r4 == 0) goto L_0x002b
            monitor-exit(r0)     // Catch:{ all -> 0x0037 }
            return
        L_0x002b:
            r5.setOnTouchListener(r3)     // Catch:{ all -> 0x0037 }
            r4 = 1
            r5.setClickable(r4)     // Catch:{ all -> 0x0037 }
            r5.setOnClickListener(r3)     // Catch:{ all -> 0x0037 }
        L_0x0035:
            monitor-exit(r0)     // Catch:{ all -> 0x0037 }
            return
        L_0x0037:
            r4 = move-exception
            monitor-exit(r0)     // Catch:{ all -> 0x0037 }
            throw r4
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.zzqj.zzb(java.lang.String, com.google.android.gms.dynamic.IObjectWrapper):void");
    }
}
